package com.hbnu.service;


import com.hbnu.dao.OrderDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
//@Controller 控制层
//@Service 业务层
//@Repository 数据层

public class OrderService {

    //@Autowired
    @Resource(name = "orderDao")//将数据层对象orderDao注入到业务层对象orderService中
    private OrderDao orderDao;

    @Value("JD123456789")
    public String orderNo;
    @Value("苹果15，小米15，华为p70")
    public String[] orderPro;


    public void addOrder(){
        System.out.println("业务层添加订单的方法......");
        orderDao.addOrder();
    }
}























